﻿     <div class="left_title_cuv"></div> 
      <div class="mid_title_cuv"><?php if(empty($_SESSION['lang'])) echo "Contact";else echo "Liên hệ"?></div>
<div class="right_title_cuv"></div>
        <div class="content">

<div class="details_conteact" >

	<div class="register" >
<?php
	$vals = array(
   'img_path' => './public/images/captcha/',
   'img_url' => base_url() . 'public/images/captcha/',
   'img_width' => 150,
   'img_height' => 30
);
$capt = create_captcha($vals);
set_secure_code($capt['word']);
$form = array("id"=>"customForm","name"=> "form_tt");

$c =&get_instance();
$c->load->model('Mprofile');
$pro =$c->Mprofile->list_data() ;
//print_r($profile);
if (!empty($pro))
foreach($pro as $profile)
 {?>
<div>
    <span style="color:#900;font-size:20px"><?php echo (empty($_SESSION["lang"]))?$profile['pro_company_en']:$profile['pro_company'] ?> </span><br />
    <span><?php  echo (empty($_SESSION["lang"]))?"Address: ".$profile['pro_address_en']:"Địa chỉ: ".$profile['pro_address'] ?>  </span><br />
    <span style="color:red">Hotline: <?php echo $profile['pro_hotline']?> </span><br />
    <span><?php if(empty($_SESSION["lang"]))echo "Phone: "; else echo "Số điện thoại: " ;echo $profile['pro_phone']?> </span><br />
	  <?php if ($profile['pro_email']!=""){?><span>Email: <a href="mailto:<?php echo $profile['pro_email']?>"><?php echo $profile['pro_email']?> </a> </span><br /><?php }?>
    
</div>
<div style="text-align:center">
<?php
 }
			echo form_open('/contact',$form);
	/*		  if(isset($missing) && is_array($missing) )
		   {
		  echo '<p class="title">Lỗi</p>';
		   echo "<div class='error' style='text-align:center'>";
		   foreach($missing as $item)
		   {
				echo $item."<br />";
		   }
		   echo "</div>";
		   }
			
		*/	
			//================THÔNG TIN XÁC THỰC================

//  echo '<p class=""></p>';

 



  //================THÔNG TIN CÁ NHÂN================

 // echo '<p class="title">THÔNG TIN CÁ NHÂN</p>';
		
 $cus_name =$this->session->userdata("name");


  //Họ lót

	echo '<div class="inner">';

  $code = 'name';

  $label =  (empty($_SESSION["lang"]))?"Full name: ":'Họ tên: ';//$this->lang->line("contact_name");

 if (! empty($missing) && array_key_exists($code, $missing))

		echo form_label($label, '', array('class'=>'error width-185'));

	else
		echo form_label($label, '', array('class'=>'width-185'));
	
	//echo "Nguyen Van a";
 $data = array("id"=>$code, "name"=>$code,"value"=>$cus_name );
 echo form_input($data);
 if (! empty($missing) && array_key_exists($code, $missing))

			echo '<span id="nameInfo" class="error">'.$missing[$code].'</span>';
else 
			echo '<span id="nameInfo" class="error"></span>';
	echo '</div>';
	
	 echo '<div class="clear"></div>';
	echo '<div class="inner">';

  $code = 'email';

  $label =  'Email';//$this->lang->line("contact_email");

 if (! empty($missing) && array_key_exists($code, $missing))

		echo form_label($label, '', array('class'=>'error width-185'));

	else
		echo form_label($label, '', array('class'=>'width-185'));
	
	//echo "Nguyen Van a";
 $data = array("id"=>$code, "name"=>$code,"value"=>$cus_name );
 echo form_input($data);
  if (! empty($missing) && array_key_exists('email', $missing))

			echo '<span id="emailInfo" class="error">'.$missing['email'].'</span>';

		else
			echo '<span id="emailInfo"></span>';	
	echo '</div>';

  //Di động
	echo '<div class="clear"></div>';
	echo '<div class="inner">';

  $code = 'title';

  $label =  (empty($_SESSION["lang"]))?"Title: ":'Tiêu đề: ';// $this->lang->line("contact_title");
if (! empty($missing) && array_key_exists($code, $missing))

		echo form_label($label, '', array('class'=>'error width-185'));

	else
  echo form_label($label, '', array('class'=>'width-185'));
 $data = array('name'=>$code,'id'=>$code, 'class'=>'width-530');
	echo form_input($data, set_value($code));
  if (! empty($missing) && array_key_exists($code, $missing))

			echo '<span id="titleInfo" class="error">'.$missing[$code].'</span>';

		else
			echo '<span id="titleInfo"></span>';
	echo '</div>';
echo '<div class="clear"></div>';
echo '<div class="inner">';
 $code = 'detail';

  $label =  (empty($_SESSION["lang"]))?"Content: ":'Nội dung: ';//  $this->lang->line("contact_detail");
if (! empty($missing) && array_key_exists($code, $missing))

		echo form_label($label, '', array('class'=>'error width-185'));

	else
  echo form_label($label, '', array('class'=>'width-185'));
	$data= array("id"=>$code,"name"=>$code,"cols"=>"25" ,"rows"=>"10");
	//echo form_textarea($data,set_value($data));contact_detail
	
	
	echo '<textarea cols="20" rows="5" name="detail" id="detail" style="width:250px;" ></textarea>';
  if (! empty($missing) && array_key_exists($code, $missing))

			echo '<span id="cmtInfo" class="error">'.$missing[$code].'</span>';

		else
			echo '<span id="emailInfo"></span>';
echo '</div>';
echo '<div class="clear"></div>';
 echo  form_label("&nbsp;");  echo $capt["image"];
 echo '<div class="clear"></div>';
echo '<div class="inner"> ';
$code = 'secure_code';
$id = 'secure_code';
$label = 'Secure Code';
$data = array('name'=>$code,'id'=>$code);
	if (! empty($missing) && array_key_exists('secure_code', $missing))

		echo form_label($label, '', array('class'=>'error width-185'));

	else
			echo form_label($label, '', array('class'=>'width-195'));

echo form_input($data);


if (! empty($missing) && array_key_exists($code, $missing))

			echo '<span id="secureInfo" class="error">'.$missing[$code].'</span>';

		else
			echo '<span id="secureInfo">*</span>';
echo '</div>';
?>
<div class="clear"></div>
<div class="inner" style="margin-left:0px;">
<input style="margin-left:103px;" type="submit" value="<?php echo (empty($_SESSION["lang"]))?"Send":"Gửi";?>"  name="send" id="send" /> &nbsp;&nbsp;&nbsp;&nbsp;

</div>

<?php

	echo form_close(); //FORM END
?> 
</div>
        </div>
                   </div>
                   </div>